package com.sunshine.simplehospital.ui.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import com.sunshine.simplehospital.R
import com.sunshine.simplehospital.adapter.MainBannerAdapter
import com.sunshine.simplehospital.adapter.RegisterAdapter
import kotlinx.android.synthetic.main.fragment_register.*

/**
 * Created by sunshine on 2020/4/29
 */
class RegisterFragment : Fragment() {

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(R.layout.fragment_register, container, false)
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
        register_recycler.layoutManager = LinearLayoutManager(context)
        register_recycler.adapter = RegisterAdapter()

        val list = ArrayList<Int>()
        list.apply {
            add(R.drawable.ic_doctor_1)
            add(R.drawable.ic_doctor_2)
            add(R.drawable.ic_medical_1)
            add(R.drawable.ic_medicine_2)
        }
        banner.adapter = MainBannerAdapter(list)
    }
}